from sqlalchemy import Column, String, Integer, Date, BigInteger, Text
from sqlalchemy.ext.declarative import declarative_base

# 创建对象的基类:
Base = declarative_base()


# 定义ThsConvertibleBondInfo对象:
class ThsConvertibleBondInfo(Base):
    # 表的名字:
    __tablename__ = 'ths_convertible_bond_info'

    # 表的结构:
    sub_date = Column(Date())
    bond_code = Column(String(255), primary_key=True)
    bond_name = Column(String(255))
    code = Column(String(255))
    name = Column(String(255))
    sub_code = Column(String(255))
    share_code = Column(String(255))
    sign_date = Column(Date())
    plan_total = Column(BigInteger())
    issue_total = Column(BigInteger())
    issue_price = Column(BigInteger())
    success_rate = Column(BigInteger())
    listing_date = Column(String(255))
    expire_date = Column(Date())
    price = Column(BigInteger())
    quota = Column(BigInteger())
    number = Column(Text(255))
    market_id = Column(Integer())
    stock_market_id = Column(Integer())

    def isEquals(self, other):
        return self.listing_date == other.listing_date
